<template>
	<view class="integral">
		<view class="inner" v-html="content">
			
		</view>
	</view>
	
</template>

<script>
	import serve from '../../static/request.js';
	import storage from '../../static/appkey.js';
	import common from '../../static/jump.js';
	import {Base64} from '../../static/base64.min.js';
	
	export default {
		data() {
			return {
				type: 'bean_rule',
				content:'',
				contentHtml : '',
			}
		},
		methods: {
			getIndex() {
				var self = this;
				serve.request({
					url: '/site/agreement',
					data: {
						appkey: uni.getStorageSync('appkey'),
						type: self.type
					}
				}).then(res => {
					wx.setNavigationBarTitle({
						title: res.data.title,
					});
					self.content = Base64.decode(res.data.content);	
					self.content = self.content.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');	
				});
			}
		},
		onLoad(options) {
			this.type = options.type;
			this.getIndex();
		},
		onPullDownRefresh() {
			this.getIndex();
		}
	}
</script>

<style lang="scss" scoped>
.integral {
	//padding: 0 27upx;
	h6 {
		font-size: 28upx;
		font-weight: bold;
		color: rgba(60, 72, 104, 1);
		margin: 48upx 0 35upx;
	}
	.top {
		p {
			font-size: 28upx;
			font-family: FZLanTingHei-R-GBK;
			font-weight: 400;
			color: rgba(60, 72, 104, 1);
		}
	}
	
	.inner{  
		overflow-y:auto;
		overflow-x:hidden;
		width: calc(100% - 100upx);
		margin: 0 50upx;
		line-height: 60upx; 
		::v-deep {
		    img,p,span {
		       width: 100%;
			   line-height: 60upx; 
		    }
		}
	}
	// .inner >>> img,p,span {
	//   width: 100%;
	// }
}
</style>
